package com.corpgovernment.organization.enumm;

import java.util.Arrays;

/**
 * Created by zll
 */
public enum FileTemplateEnum {
    SyncOrgTemplate("SyncOrgTemplate", "组织同步模板.xlsx"),
    SyncEmpTemplate("SyncEmpTemplate", "员工同步模板.xlsx"),
    SyncProjectTemplate("SyncProjectTemplate", "项目同步模板.xlsx"),
    SyncCostInfoTemplate("SyncCostInfoTemplate", "成本中心同步模板.xlsx"),
    SyncHotelQuarterTemplate("SyncHotelQuarterTemplate", "淡旺季差标导入模板.xlsx"),
    SyncHotelAreaConfTemplate("SyncHotelAreaConfTemplate", "差标酒店地区配置导入模板.xlsx"),
    SyncRedemptionCodeTemplate("SyncRedemptionCodeTemplate", "兑换码导入模板.xlsx");

    FileTemplateEnum(String dealCode, String dealMsg) {
        this.dealCode = dealCode;
        this.dealMsg = dealMsg;
    }

    private String dealCode;
    private String dealMsg;

    public String getDealCode() {
        return dealCode;
    }

    public void setDealCode(String dealCode) {
        this.dealCode = dealCode;
    }

    public String getDealMsg() {
        return dealMsg;
    }

    public void setDealMsg(String dealMsg) {
        this.dealMsg = dealMsg;
    }

    public static String getTemplateName(String dealCode) {
        FileTemplateEnum fileTemplateEnum = Arrays.stream(FileTemplateEnum.values()).filter(x -> x.getDealCode().equals(dealCode)).findFirst().orElse(null);
        if (fileTemplateEnum == null) {
            return null;
        }
        return fileTemplateEnum.getDealMsg();
    }
}
